// -----------------------------
// Author: 		Dhaenens Gert 
// Creation: 	12/11/2014 10:56:13 AM				
// -----------------------------

#ifndef _SkyboxGenerator_h
#define _SkyboxGenerator_h

#include "Common.h"

struct SkyboxDesc
{
	UInt32	Width;
	UInt32	Height;
	Color	HorizonColor;
	Color	SkyColor;
	Color	CloudColor;
	Float	HorizonStart;
	Float	HorizonEnd;
	Int32	HorizonPower;
	Float	CloudStart;
	Float	CloudEnd;
	Float	CloudThreshold;
	Float	CloudScale;
	Float	CloudBorder;
};

class Application;

class SkyboxGenerator
{
public:

	static ITexture2D*		Generate(Application* lpApp, const SkyboxDesc& desc);

private:

	static void				GenerateSideFace(Application* lpApp, const SkyboxDesc& desc, Float* lpAddress);
	static void				FillFace(Application* lpApp, const SkyboxDesc& desc, Float* lpAddress, const Color& clr);
	static void				FillFaceChecker(Application* lpApp, const SkyboxDesc& desc, Float* lpAddress);
	static void				GenerateSideCloud(Application* lpApp, const SkyboxDesc& desc, Float* lpAddress, UInt32 otherValue, UInt32 otherMaxValue, Bool isSideFace);
	static void				GenerateFaceCloud(Application* lpApp, const SkyboxDesc& desc, Float* lpAddress);

	SkyboxGenerator();
	~SkyboxGenerator();
	SkyboxGenerator(const SkyboxGenerator& refSkyboxGenerator);
	SkyboxGenerator& operator=(const SkyboxGenerator& refSkyboxGenerator);
};

#endif